package com.prs.crm.domain.oa.schedule;

import java.util.Date;
import java.util.List;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;
import com.prs.crm.domain.hr.Dept;
import com.prs.crm.domain.hr.Person;
/**
 * @author YangHao
 * @E-Mail:450098606@qq.com
 * @qq:450098606
 * @version 创建时间：2012-4-16 15:40:59 我的日记
 */
@Entity
@Table(name="oa_diary")
public class Diary extends BaseEntity{

	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	/**
	 * 标题
	 */
	private String title;
	
	private Date lastTime;
	@ManyToOne
	private Person person;
	/**
	 *内容
	 */
	private String content;  
	private Date createTime;
	/**
	 * 评论数
	 */
	private Integer spkNum;  
	/**
	 * 阅读数
	 */
	private Integer readNum;  
	/**
	 * 最后评论人
	 */
	private String lastName;  
	@ManyToOne(fetch=FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Attachment attach; 
	@OneToMany(fetch = FetchType.LAZY,mappedBy="diary")
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private List<DiaryReply> diaryReply;
	
	private Integer type;
	private String upTime;
	private String upPerosn;
	private String showState;
	public String getShowState() {
		return showState;
	}
	public void setShowState(String showState) {
		this.showState = showState;
	}
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	public String getUpTime() {
		return upTime;
	}
	public void setUpTime(String upTime) {
		this.upTime = upTime;
	}
	public String getUpPerosn() {
		return upPerosn;
	}
	public void setUpPerosn(String upPerosn) {
		this.upPerosn = upPerosn;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public Date getLastTime() {
		return lastTime;
	}
	public void setLastTime(Date lastTime) {
		this.lastTime = lastTime;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public Integer getSpkNum() {
		return spkNum;
	}
	public void setSpkNum(Integer spkNum) {
		this.spkNum = spkNum;
	}
	public Integer getReadNum() {
		return readNum;
	}
	public void setReadNum(Integer readNum) {
		this.readNum = readNum;
	}
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	public Attachment getAttach() {
		return attach;
	}
	public void setAttach(Attachment attach) {
		this.attach = attach;
	}

	public List<DiaryReply> getDiaryReply() {
		return diaryReply;
	}
	public void setDiaryReply(List<DiaryReply> diaryReply) {
		this.diaryReply = diaryReply;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}

	public Person getPerson() {
		return person;
	}
	public void setPerson(Person person) {
		this.person = person;
	}
	
}
